<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String basePath = request.getScheme() +
            "://"
            + request.getServerName() + ":"
            + request.getServerPort()
            + request.getContextPath() + "/";
    int index=1;
%>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <meta charset="UTF-8">
    <link href="jquery/bootstrap_3.3.0/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
    <script type="text/javascript" src="jquery/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="jquery/bootstrap_3.3.0/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $(function (){

            $.ajax({
                url:"workbench/student/practice/getConcreteExaminationSituation.do",
                data:{
                    "situationId":${examinationSituation.id}
                },
                type:"post",
                dataType:"json",
                success:function (data){
                    if(data.success){
                        $.each(data.dataList,function (i,n){
                            if(n.isRight=='Y'){
                                $("#s"+n.qid).attr("class","glyphicon glyphicon-ok")
                                $("#s"+n.qid).attr("style","color: #00B83F")
                            }else {
                                $("#s"+n.qid).attr("class","glyphicon glyphicon-remove")
                                $("#s"+n.qid).attr("style","color: red")
                                var html="正确答案是"+n.rightAnswer
                                $("#r"+n.qid).html(html)
                            }
                            var answers=$("input[name=answer_"+n.qid+"]");
                            for (var j = 0; j < answers.length; j++) {
                                $(answers[j]).prop("checked",answers[j].value==n.stuAnswer)
                            }
                        })
                    }
                }
            })

            $("#returnBtn").click(function (){
                window.history.back();
            })
        })
    </script>
</head>
<body>
<h2>${examination.eName}</h2>
<h3>姓名:${examinationSituation.studentId}</h3>
<h3 >试卷得分:<span style="color: red;font-size: 30px">${examinationSituation.score}</span></h3>
<h3 style="font-size: 30px">完成时间:  ${examinationSituation.finishTime}</h3>
<hr>
<br><br>
<table style="position: relative;left: 350px">
    <tr>
        <td>名称</td>
        <td>${examination.eName}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td>成绩类型</td>
        <td>百分制&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
        <td>开始日期</td>
        <td>${examination.startTime}</td>
    </tr>
    <tr>
        <td>题目数</td>
        <td>${examination.eName}</td>
        <td>总分数</td>
        <td>${10*examination.count}</td>
        <td>结束日期</td>
        <td>${examination.endTime}</td>
    </tr>
</table>
<c:forEach items="${questionList}" var="n">
    <br> <br>
    <hr>
    <div id="${n.qid}" style="position: relative;left: 350px">
        <div style="position: relative;top: 15px;">
            <span><%=index++%>.  </span>
            <span>${n.head} </span>
            <span> (    )   (10分）      </span>
            <span id="s${n.qid}">&nbsp;&nbsp;</span>
            <span id="r${n.qid}" style="color: red"></span>
        </div>
        <br>
        <div style="position: relative;top: 10px;">
            <span><input type="radio" name="answer_${n.qid}" value="A" style="width:15px;height: 15px;" disabled></span>
            <span>A.     </span>
            <span>${n.answerA}</span>
        </div>
        <br>
        <div style="position: relative;top: 10px;">
            <span><input type="radio" name="answer_${n.qid}" value="B" style="width:15px;height: 15px;" disabled></span>
            <span>B.     </span>
            <span>${n.answerB}</span>
        </div>
        <br>
        <div style="position: relative;top: 10px;">
            <span><input type="radio" name="answer_${n.qid}" value="C" style="width:15px;height: 15px" disabled></span>
            <span>C.     </span>
            <span>${n.answerC}</span>
        </div>
        <br>
        <div style="position: relative;top: 10px;">
            <span><input type="radio" name="answer_${n.qid}" value="D" style="width:15px;height: 15px;" disabled></span>
            <span>D.     </span>
            <span>${n.answerD}</span>
        </div>
    </div>
</c:forEach>
    <br><br><br>
    <button style="position: relative;left: 600px;width: 60px;height: 40px" id="returnBtn">返回</button>
</body>
</html>